Skip to content

BASE_URL w/o /api#357

Merged
Germandrummer92 merged 2 commits intomainfrom
use-plain-BASE_URL-w/o-api-prefix
Jan 27, 2026
Merged

BASE_URL w/o /api#357
Germandrummer92 merged 2 commits intomainfrom
use-plain-BASE_URL-w/o-api-prefix

Conversation

@sker65
Copy link
Contributor

@sker65 sker65 commented Jan 26, 2026

Summary by CodeRabbit

  • Chores

    • Version bumped to 4.5.1
    • Harmonized base URL handling and API path composition across the app
  • Documentation

    • Updated README version badge/text to 4.5.1
  • Tests

    • Updated tests to reflect the new API path prefixes used by authenticated endpoints

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 26, 2026

📝 Walkthrough

Walkthrough

The PR bumps the package to 4.5.1 and centralizes the /api namespace: BASE_URL no longer includes /api, /api is appended during client initialization and added to bearer-token endpoint paths and URL constructors across several tools and tests. No API signatures changed.

Changes

Cohort / File(s) Summary
Version & docs
README.md, package.json
Version updated from 4.5.0 → 4.5.1; package.json dev script env URLs changed to remove trailing /api.
Client init
src/tools/client.ts
BASE_URL default changed from https://app.octomind.dev/apihttps://app.octomind.dev; client now initializes with baseUrl: \${BASE_URL}/api``.
Bearer-token API paths
src/tools/environments.ts, src/tools/playwright.ts, src/tools/test-cases.ts
Endpoints updated to include /api prefix for bearer-token flows (e.g., /bearer/v1/.../api/bearer/v1/...).
URL construction
src/url.ts
Replaced dynamic origin extraction with direct use of BASE_URL in generated URLs (test-case, test-target, reports, etc.).
YAML local edit links
src/tools/yamlMutations/create.ts, src/tools/yamlMutations/edit.ts
Replaced URL.parse usage and build local editing URLs directly from BASE_URL.
Tests
tests/tools/environments.spec.ts, tests/tools/playwright.spec.ts
Updated expectations to match new /api/bearer/v1/... paths.

Sequence Diagram(s)

(Skipped — changes are URL/path updates and do not introduce new multi-component control flow.)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • Germandrummer92

Poem

🐰 I hopped through strings and tweaked each route,
Removed a trailing /api — that’s what I’m about!
From client to tests the namespace now sings,
Bumped to 4.5.1 — hear the rabbit's springy springs!

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title 'BASE_URL w/o /api' is directly related to the main change in the changeset, which involves removing the '/api' suffix from BASE_URL constants and updating all API endpoint paths to construct the '/api' prefix dynamically.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@src/tools/client.ts`:
- Around line 8-19: The BASE_URL currently uses process.env.OCTOMIND_API_URL
directly which can already include a trailing "/api", causing double "/api" when
createClient is called; update the BASE_URL computation (the constant named
BASE_URL used when creating client via createClient<paths>) to detect and remove
a trailing "/api" (or trailing slash + "api") from process.env.OCTOMIND_API_URL
if present, falling back to "https://app.octomind.dev" when unset, so the final
baseUrl passed to createClient is always single "/api" appended.

In `@src/tools/test-cases.ts`:
- Around line 130-132: The URL construction in src/tools/test-cases.ts currently
concatenates BASE_URL with a path string which can produce duplicate "/api"
segments when BASE_URL already contains "/api"; update the code that builds the
URL (the const url = new URL(...) usage) to call new URL with the path as the
first argument and BASE_URL as the second (e.g., new
URL("/api/bearer/v1/test-targets/${options.testTargetId}/test-cases", BASE_URL))
so the URL constructor normalizes the path regardless of whether BASE_URL
already includes "/api". Ensure you reference BASE_URL and options.testTargetId
in the replacement to preserve behavior.

@Germandrummer92 Germandrummer92 merged commit c4c42b3 into main Jan 27, 2026
4 checks passed
@Germandrummer92 Germandrummer92 deleted the use-plain-BASE_URL-w/o-api-prefix branch January 27, 2026 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments